/* 
 * File:   MyBatchMergeModel.h
 * Author: Morpheus
 *
 * Created on 20 juin 2013, 23:40
 */

#ifndef MYBATCHMERGEMODEL_H
#define	MYBATCHMERGEMODEL_H

#include <QtCore/qabstractitemmodel.h>
#include <QtCore/qbytearray.h>
#include <QtCore/qstringlist.h>

#include "MyBatchMerge.h"

class MyBatchMergeModel : public QAbstractTableModel {
    Q_OBJECT
public:
    MyBatchMergeModel(QObject* parent = 0);
    virtual ~MyBatchMergeModel();
    void appendSeveralBatch(const QByteArray&);
    void setBatchs(const QList<MyBatchMerge>&);
    void appendBatch(MyBatchMerge);
    void removeBatch(const QList<int>& uuids);
    
    QList<MyBatchMerge> getAllBatch() const;
    QByteArray getAllBatchArray() const;
    QByteArray getBatchArray(const int& uuid) const;
    QModelIndex getBatchIndex(const int& uuid) const;
    
    MyBatchMerge getBatch(const QModelIndex& index) const;
    MyBatchMerge getBatch(const int& uuid) const;
    
    void setCurBatchMerge(const int& );
    int getCurBatchMerge() const;
    
    virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
    virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
    virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
    
private:
    QList<MyBatchMerge> m_dataList;
    int m_curBatchId;

};

#endif	/* MYBATCHMERGEMODEL_H */

